﻿/*
#------------------------------------------------------------------------------
#-- View Name:		[dbo].[vwDatabase_DoNotBackup]
#-- Purpose:		Provides a table view of the CSV column dbo.tblConfiguration.cfg_bkp_skip_db
#--	Last Update:	04/17/2012
#--					For a complete history - please review comments in Version 
#--					Control
#------------------------------------------------------------------------------
*/
CREATE VIEW [dbo].[vwDatabase_DoNotBackup]
AS

SELECT			skip_db.db.value('.', 'sysname') database_name
FROM			(
				SELECT		CAST('<A>' + REPLACE(REPLACE(cfg_bkp_skip_db, ' ', ''), ',', '</A><A>') + '</A>' AS XML) skip_db
				FROM		dbo.tblConfiguration (NOLOCK)
				) t1
CROSS APPLY		skip_db.nodes('/A') skip_db(db)
WHERE			LTRIM(RTRIM(skip_db.db.value('.', 'sysname'))) <> ''
